package com.zlx.guguanjia.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zlx.guguanjia.entity.Demand;
import com.zlx.guguanjia.mapper.DemandMapper;
import com.zlx.guguanjia.service.DemandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Author 周罗校
 * @Description
 * @ClassName DemandServiceImpl
 * @date 2020.10.24 09:53:16
 * 该版权归周罗校所有，最终解释权以官方为准
 */
@Transactional
@Service
public class DemandServiceImpl extends BaseServiceImpl<Demand,Long> implements DemandService {
    @Autowired
    private DemandMapper demandMapper;
    /***
     * @Author 周罗校
     * @Description 查询并分页
     * @Param [start, pageSize]
     * @return com.github.pagehelper.PageInfo<com.zlx.guguanjia.entity.Demand>
     * @Date 2020.10.24 10:01:00
     **/
    @Override
    public PageInfo<Demand> selectPage(int start,int pageSize) {
        PageHelper.startPage(start,pageSize);
        Demand demand = new Demand();
        demand.setDelFlag("0");
        List<Demand> select = demandMapper.select(demand);
        return new PageInfo<>(select);
    }
}
